package com.example.spring_boot_demo.controller;

import com.example.spring_boot_demo.dto.Goods;
import com.example.spring_boot_demo.dto.GoodsRequest;
import com.example.spring_boot_demo.mapper.GoodsMapper;
import com.example.spring_boot_demo.service.GoodsService;
import com.example.spring_boot_demo.utils.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <P> @Author: SongKeCheng
 * <P> Type: Class
 * <P> Description:
 * <P> Date: 2024/12/18:17:57
 */

@SuppressWarnings({"unchecked", ""})
@RestController
@RequestMapping("goods")
public class GoodsController {
    private static final Logger log = LoggerFactory.getLogger(GoodsController.class);

    @Autowired
    private GoodsService goodsService;

    @Autowired
    private GoodsMapper goodsMapper;

    @GetMapping("/findGoods")
    public AjaxResult findGoods(GoodsRequest goodsRequest){
        goodsMapper.findGoods(goodsRequest);
       return  goodsService.findGoods(goodsRequest);
    }
}
